﻿using System;

namespace _05_NullableDemo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int? num1 = null;
            int? num2 = 123;
            int num3;
            // 如果num1为null，则num3赋值为2
            num3 = num1 ?? 2;
            Console.WriteLine("num3 = {0}", num3);
            Console.ReadKey();
        }
    }
}
